<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>菜鸟教程(runoob.com)</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" />
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<p>你好世界!</p>
<div id="main">
    <p class="p1"> DOM 是非常有用的。</p>
    <p class="p1">该实例展示了  <b>getElementsByTagName</b> 方法</p>
</div>
<script>
    $(function () {
        let div = $("#main");
        console.log(div)
        window.location.assign("https://www.runoob.com")
        window.open("https://www.baidu.com");

    })
    var x=document.getElementById("main");
    var y=x.getElementsByTagName("p");
    var z = document.getElementsByClassName("p1");
    console.log(x)
    console.log(y)
    console.log(z)
    document.write('id="main"元素中的第一个段落为：' + y[0].innerHTML);
</script>

</body>
</html>